import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    input: true,
    car: 0,
    userInfo: {}
  },
  mutations: {
    setDValue (state, demoValue) {
      state.input = demoValue
    },
    setcart (state, demoValue) {
      state.car = demoValue
    },
    setUser (state, obj) {
      state.userInfo = obj;
    }
  },
  actions: {
  },
  modules: {
  },
  getters: {
    isinput (state) {
      return state.input
    },
    cartsum (state) {
      return state.car
    },
    getuser (state) {
      return state.userInfo;
    }
  }
})
